#include "inet.h"
#include "error.h"

#include <arpa/inet.h>

uint16_t Wrap::htons_(uint16_t hostshort) {
    return ::htons(hostshort);
}

int Wrap::inet_aton_(const char *cp, struct in_addr *inp) {
    return PERROR_EQ0(::inet_aton(cp, inp));
}

char *Wrap::inet_ntoa_(struct in_addr in) {
    return ::inet_ntoa(in);
}

const char *Wrap::inet_ntop_(int af, const void *cp, char *buf, socklen_t_ len) {
    return PERROR_EQ0(::inet_ntop(af, cp, buf, len));
}

int Wrap::inet_pton_(int af, const char *cp, void *buf) {
    return PERROR_NEG(::inet_pton(af, cp, buf));
}
